import { select } from '@inquirer/prompts'

async function startDevPreview() {
  const NODE_ENV = await select({
    message: `Choose the environment you want to start:`,
    default: 'Overwrite',
    choices: [
      { name: 'development', value: 'development' },
      { name: 'production', value: 'production' },
      // @ts-ignore
      { name: 'Cancel', value: false },
    ],
  })
  if (!NODE_ENV) {
    process.exit(1)
  } else {
    process.env.NODE_ENV = NODE_ENV
    await import('./run.ts')
  }
}

await startDevPreview()
